<template>
	<view class="conference-list">
		<view class="conference-list-top">
			<image :src="info.url || img" mode="" class="conference-list-top-img"></image>
			<view class="conference-list-top-info">
				<view class="one">
					<view class="title">
						{{ info.name }}
					</view>
					<view class="btn" @click="appoint">
						预定
					</view>
				</view>
				<view class="two">
					{{ info.location }}
				</view>
				<view class="three">
					<view class="left">
						容纳{{ info.capacity }}人
					</view>
					<view class="line"></view>
					<view
						class="right"
						:style="info.status ? {
							color: '#FAC52B',
							background: 'rgba(250, 197, 43, .2)'
						}:{}"
					>
						{{ info.status ? '当前会议中' : '当前空闲中'}}
					</view>
				</view>
			</view>
		</view>
		<ConferenceRuler :time="info.time"></ConferenceRuler>
	</view>
</template>

<script>
	import ConferenceRuler from '@/components/conferencemanagement/ConferenceRuler.vue';
	const img = require('@/static/images/conference/conference-room.png');
	export default {
		name: 'ConferenceList',
		props: {
			info: {
				type: Object
			}
		},
		data() {
			return {
				img
			};
		},
		components: {
			ConferenceRuler
		},
		methods: {
			appoint() {
				uni.navigateTo({
					url: `/pages/conferencemanagement/appointform?info=${JSON.stringify(this.info)}`,
					success: res => {},
					fail: () => {},
					complete: () => {}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.conference-list {
		padding: 20px 0;
		margin-bottom: 10px;
		
		background-color: #FFFFFF;
		&-top {
			display: flex;
			
			padding: 0 30rpx 0 20rpx;
			margin-bottom: 20px;
			&-img {
				width: 244rpx;
				height: 86px;
				border-radius: 8rpx;
				
				margin-right: 5px;
			}
			&-info {
				flex: 1;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				.one {
					display: flex;
					justify-content: space-between;
					align-items: center;
					.title {
						font-size: 28rpx;
						
						color: #101010;
					}
					.btn {
						width: 140rpx;
						height: 20px;
						line-height: 20px;
						text-align: center;
						border-radius: 8rpx;
						
						font-size: 24rpx;
						
						color: #FFFFFF;
						background-color: $uni-color-primary;
					}
				}
				.two {
					font-size: 24rpx;
					
					color: #8E8E8E;
				}
				.three {
					display: flex;
					align-items: center;
					.left {
						width: 120rpx;
						height: 20px;
						line-height: 20px;
						text-align: center;
						border-radius: 6rpx;
						
						font-size: 24rpx;
						
						color: $uni-color-primary;
						background-color: rgba(69, 122, 255, .2);
					}
					.line {
						width: 2rpx;
						height: 20px;
						margin: 0 40rpx;
						
						background-color: #E8E8E8;
					}
					.right {
						width: 120rpx;
						height: 20px;
						line-height: 20px;
						text-align: center;
						border-radius: 6rpx;
						
						font-size: 24rpx;
						
						color: #59B500;
						background-color:  rgba(89, 181, 0, .2);
					}
				}
			}
		}
	}
</style>
